package com.eaoa.uc.pubmessage.bo;

import java.util.ArrayList;
import java.util.List;

import com.eaoa.base.EABaseBusinessObject;
import com.eaoa.dao.pub.PubMessageDAO;
import com.eaoa.vo.pub.PubMessage;

public class MessageModifyBatchBO extends EABaseBusinessObject{

	private static PubMessageDAO messageDAO = new PubMessageDAO();
	private List messages ;
	private PubMessage vo ;
	public MessageModifyBatchBO(List messages ) {
		super();
		this.messages = messages;
	}
	
	public MessageModifyBatchBO(PubMessage vo ) {
		super();
		this.vo = vo;
	}
	
	@Override
	protected void performBusinessLogic() {
		if(messages == null && vo!=null){
			messages = new ArrayList();
			messages.add(vo);
		}
		
		messageDAO.saveOrUpdateBatch(messages);
	}
}
